#ifndef SETTING_H
#define SETTING_H

#include <QWidget>
#include <functional>

#include "baseform.h"
#include "model/parammodel.h"

namespace Ui {
class Setting;
}

class Setting : public BaseForm
{
    Q_OBJECT

public:
    explicit Setting(BaseForm *parent = 0);
    ~Setting();

    void setUpdateMainCallback(std::function<void()> _callBack);

protected:
    void initWindow();

private slots:
    void on_btnSetttingOK_clicked();

    void on_btnSetttingCancel_clicked();

private:
    Ui::Setting *ui;

    ParamModel paramModel;
    std::function<void()> updateMainCallback;

    void saveTestParamWidget();
    void saveTestFTD();
    void saveTestProtect();
    void saveTestInfo();

    void readTestParamWidget();
    void readTestFTD();
    void readTestProtect();
    void readTestInfo();
};

#endif // SETTING_H
